"use strict";
cc._RF.push(module, 'ab17ah2k+BEgbzYuLOI2va3', 'PromoNodeArr');
// scripts/PromoNodeArr.js

"use strict";

var e = require;
var t = module;
var n = exports;
Object.defineProperty(n, "__esModule", {
  value: !0
});

var o = e("PromoNodeArrItem"),
    i = cc._decorator,
    a = i.ccclass,
    r = i.property,
    s = function (e) {
  __extends(t, e);

  function t() {
    var t = null !== e && e.apply(this, arguments) || this;
    t.items = [];
    t.extentBtns = [];
    t.mDatas = null;
    return t;
  }

  t.prototype.onLoad = function () {
    SDK.Base.Event.on("getData", this.initData, this);
    this.initData();
  };

  t.prototype.onDestroy = function () {
    SDK.Base.Event.off("getData", this.initData, this);
  };

  t.prototype.initData = function () {
    if (SDK.Mgr.Inst.hasPromoData && (SDK.Mgr.Inst.curChannel != SDK.Define.Channel.oppo || SDK.Mgr.Inst.isAdOpen)) {
      this.node.active = !0;
      this.mDatas = Config.Base.promoData;
      this.setData();

      for (var e = 0; e < this.extentBtns.length; e++) {
        this.extentBtns[e].active = !0;
      }
    } else this.node.active = !1;
  };

  t.prototype.setData = function () {
    for (var e = 0; e < this.items.length; e++) {
      this.items[e].setData(this.mDatas.content[e]);
    }
  };

  __decorate([r(o["default"])], t.prototype, "items", void 0);

  __decorate([r([cc.Node])], t.prototype, "extentBtns", void 0);

  return __decorate([a], t);
}(cc.Component);

n["default"] = s;

cc._RF.pop();